﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TEL.ClientClasses;
using TEL.ClientClasses.SipInterfaces;

namespace TEL.TelPhoneF
{
    public partial class FrmAnsweringMachine : Form , IAnsweringMachine
    {
        public FrmAnsweringMachine()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            AnswerSave = !AnswerSave;
            button1.Text = AnswerSave ? "STOP" : "START";
        }

        #region Implementation of IAnsweringMachine

        private bool answerSave = false;
        public bool AnswerSave
        {
            get { return answerSave; }
            set
            {
                answerSave = value;
                if(AnswerSaveEvent != null) AnswerSaveEvent(this, new BoolEventArgs(value));
            }
        }

        public event EventHandler<BoolEventArgs> AnswerSaveEvent;
      

        #endregion
    }
}
